/* 
* @Author: anchen
* @Date:   2018-12-31 10:08:15
* @Last Modified by:   anchen
* @Last Modified time: 2018-12-31 15:53:03
*/
$(function () {

});

function searchData() {


    var table = layui.table, layer = layui.layer;

    table.init('serviceTable',{
        data: [
            {
                id:1,
                "TYSHXYDM":"5144****2XB",
                "DWMC":"光电子信息科技有限公司",
                "DH":"18150980999",
                "ZS":"广东韶关山水",
                "YZBM":"350322",
                "FDDBRXM":"黄水样"
            }
        ]
        , toolbar: true
        , title: '社会团体注销信息'
        , page: true
    });

    //监听行工具事件
    table.on('tool(serviceTable)', function (obj) { //注：tool 是工具条事件名，test 是 table 原始容器的属性 lay-filter="对应的值"
        var data = obj.data //获得当前行数据
            , layEvent = obj.event; //获得 lay-event 对应的值

        if (layEvent === 'detail') {
            loadDetail(data.id)
        }
    });
}

function loadDetail(id) {
    var data = [
            {
                "TYSHXYDM":"5144****2XB",
                "DWMC":"光电子信息科技有限公司",
                "DH":"18150980999",
                "ZS":"广东韶关山水",
                "YZBM":"350322",
                "FDDBRXM":"黄水样",
                "YWZGDW":"广东省**学会",
                "HDDY":"广东",
                "STLX":"运动类",
                "ZXYY":"缺少经费",
                "ZXRQ":"2018-09-12",
                "GXSJ":"2018-12-31"
            }
    ];


    var data0 = data[parseInt(id) - 1];

    $('#detailD').html(template('detailDS',{data:data0}))
    layer.open({
        type: 1,
        content: $("#detail"),
        area: ['900px', '550px'],
        title: '社会团体注销信息',
        maxmin: true,
        shade: 0,
        cancel: function () {
            $("#detail").hide()
        }
    });


}